//
//  HYFunctionManager.m
//  HYApp
//
//  Created by victor lau on 2018/12/10.
//  Copyright © 2018年 Unidax. All rights reserved.
//

#import "HYFunctionManager.h"
#import <JFBase/JFBase.h>

@implementation HYFunctionManager

//app是否登录了
+(BOOL)appHadLogin
{
    JFMsgCenterVo * msg = [[JFMsgCenterVo alloc] init];
    msg.from = @"App";
    msg.to = @"HYUser";
    msg.requestNum = @"900006";
    JFMsgCenterVo * data = [JFMsgCenteManager requestWithMsgCenterVo:msg callback:^(JFResultVo *resultVo) {
        // NSLog(@"%@",resultVo.errorInfo);
    }];
    NSString * login =  data.params[@"loginStatus"];
   return  [login boolValue];
}



//present login
+(void)presentLoginVcSuccessBlock:(void(^)(JFResultVo * result))success failure:(void (^)(JFResultVo * result))fail
{
    JFMsgCenterVo * msg = [[JFMsgCenterVo alloc] init];
    msg.from = @"App";
    msg.to = @"HYUser";
    msg.requestNum = @"900001";
    msg.callback = ^(JFResultVo *resultVo){
        
        if(resultVo.errorNo == 0){
            success(resultVo);
        }else{
            fail(resultVo);
        }
        NSLog(@"%@",resultVo.results);
    };
    JFMsgCenterVo * data = [JFMsgCenteManager requestWithMsgCenterVo:msg callback:^(JFResultVo *resultVo) {
        // NSLog(@"%@",resultVo.errorInfo);
    }];
}

//处理token失效的通知
+(void)handleTokenInvalidNotify
{
    
    JFMsgCenterVo * msg = [[JFMsgCenterVo alloc] init];
    msg.from = @"App";
    msg.to = @"HYUser";
    msg.requestNum = @"900003";
    JFMsgCenterVo * data = [JFMsgCenteManager requestWithMsgCenterVo:msg callback:^(JFResultVo *resultVo) {
        // NSLog(@"%@",resultVo.errorInfo);
    }];
}

//处理手势
+(void)handleGesturePring
{
    JFMsgCenterVo * msg = [[JFMsgCenterVo alloc] init];
    msg.from = @"App";
    msg.to = @"HYUser";
    msg.requestNum = @"900011";
    JFMsgCenterVo * data = [JFMsgCenteManager requestWithMsgCenterVo:msg callback:^(JFResultVo *resultVo) {
        // NSLog(@"%@",resultVo.errorInfo);
    }];
}



@end
